
<template>
  <div>
    <el-collapse v-model="activeNames" @change="handleChange">
      <el-collapse-item title="基本信息" name="1">
        <!-- 这里是表单的基本信息 -->
        <el-form
          v-if="active == 0"
          :model="ruleForm"
          ref="ruleForm"
          label-width="100px"
          class="demo-ruleForm"
        >
          <el-form-item label="编码" prop="number">
            <el-input v-model="ruleForm.number"></el-input>
          </el-form-item>
          <el-form-item label="名称" prop="name">
            <el-input v-model="ruleForm.name"></el-input>
          </el-form-item>
          <el-form-item label="流程类型" prop="flowtype">
            <el-input v-model="ruleForm.flowtype"></el-input>
          </el-form-item>
          <el-form-item label="描述" prop="decription">
            <el-input v-model="ruleForm.decription"></el-input>
          </el-form-item>
        </el-form>
      </el-collapse-item>
      <el-collapse-item title="活动环节设置" name="2">
        <!-- 流程环节设置：采用标签的方式 -->
        <el-tag
          v-for="tag in tags"
          :key="tag.name"
          @click="handleClick($event)"
          closable
          :type="tag.type"
        >
          {{ tag.name }}
        </el-tag>
      </el-collapse-item>
      <el-collapse-item title="流程信息" name="3">
        <!-- 具体的流程的设置 -->
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
          <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
          <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
          <el-tab-pane label="定时任务补偿" name="fourth"
            >定时任务补偿</el-tab-pane
          >
        </el-tabs>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>
  <script>
export default {
  name: "AddPerfWorkflow",

  data() {
    return {
      activeNames: ["1"],
      //  表单参数
      ruleForm: {
        name: "",
        number: "",
        scoresystem: "",
        sumperflevel: "",
        scorecalcway: "",
      },
      tags: [
        { name: "指标制定", type: "" },
        { name: "绩效评估", type: "success" },
        { name: "结果汇总", type: "info" },
        { name: "绩效校准", type: "warning" },
        { name: "结果确认", type: "danger" },
      ],
      activeName: "second",
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    handleChange(val) {
      //console.log(val);
    },
    handleClick(event) {
      console.log(event.currentTarget); // 这将给你标签的 DOM 元素
    },
  },
};
</script>